package com.app.test.leak

/**
 * 内存泄漏测试manager
 *
 * @author lucher
 * @since 2023-05-28
 */
object LeakManager {

    //静态监听器，用于模拟内存泄漏
    private val listeners: MutableList<LeakListener> = ArrayList()

    /**
     * 注册监听
     */
    fun register(listener: LeakListener) {
        listeners.add(listener)
    }

    /**
     * 取消监听
     */
    fun unregister(listener: LeakListener) {
        listeners.remove(listener)
    }
}